﻿@{
    Layout = "_LayoutMobile";
    ViewBag.Title = "我的";
}
@section header {
    <style>
        #app {
            padding-top: 0;
        }
        .user-center-card {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 160px;
            background-image: url('https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png');
            background-size: cover;
            background-repeat: no-repeat;
            padding: 0 12px;
        }

        .user-center-card__header {
            margin-top: 56px;
            margin-bottom: 24px;
            height: 48px;
            line-height: 24px;
            display: flex;
            justify-content: flex-start;
            align-items: center;
            color: #333;
            position: relative;
        }

        .user-center-card__header__avatar {
            width: 48px;
            height: 48px;
            border-radius: 24px;
            overflow: hidden;
        }

        .user-center-card__header__name {
            font-size: 18px;
            line-height: 24px;
            color: #333;
            font-weight: bold;
            margin-left: 12px;
            margin-right: 8px;
        }

        .user-center-card__header__transparent {
            position: absolute;
            left: 0;
            top: 0;
            background-color: transparent;
            height: 100%;
            width: 100%;
        }

        .user-center-card__icon {
            line-height: 48px;
        }

        .content-wrapper{
            margin: 130px 5px 0 5px;
            padding-top: 5px;
            border-radius: 8px;
        }
    </style>
}
@* <van-nav-bar title="我的" :fixed="true">
</van-nav-bar> *@
<div class="user-center-card">
        <div class="user-center-card__header">
            <van-image round
                       class="user-center-card__header__avatar"
                       src="https://cdn-we-retail.ym.tencent.com/miniapp/usercenter/icon-user-center-avatar@2x.png">
            </van-image>
        <div class="user-center-card__header__name">{{global.user.name}}</div>
        </div>
</div>
<van-cell-group class="content-wrapper">
    <van-cell title="加工订单" is-link center icon="/img/order_active.png" :url="'@Url.Action("MobileList","Machining")'"></van-cell>
    <van-cell title="客户信息" is-link center icon="/img/customer.png" :url="'@Url.Action("MobileList","Partner")'"></van-cell>
    <van-cell title="应收款" is-link center icon="/img/ys_active.png" :url="'@Url.Action("MobileAllList","FinanceRecvDue")'"></van-cell>
    <van-cell title="收款单" is-link center icon="/img/sk_active.png" :url="'@Url.Action("MobileList","FinanceRecv")'"></van-cell>
    <van-cell title="修改密码" is-link center icon="/img/changepasswd.png" :url="'@Url.Action("MobileChangePasswd","Sys_User")'"></van-cell>
    <van-cell title="退出登录" is-link center icon="/img/logout.png" @@click="goLogout"></van-cell>
</van-cell-group>
@section footer {
    <script type="text/javascript">
        var modelJson={};
        var modelData = $.extend(modelJson, {});
        var pageApp = new Vue({
             el: '#app',
                data: {
                    active:'my',
                    model:modelData,
                    global: globalData,
                },
                methods: {
                    goLogout(){
                        window.location.href = '@(Url.Action("MobileLogout", "Sys_User"))';
                    },
                },
                filters: {
                    formatDate: function (val) {
                        return utils.formatDate(val, 'yyyy-MM-dd');
                    },
                },
        });
        $(function () {
            if(!isMobile())
            {
                    window.location.href = '@(Url.Action("Index", "Home"))';
            }
        });

        function isMobile() {
          const regExp = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
          return regExp.test(navigator.userAgent);
        }
    </script>
}

